﻿using Orchard;
using Orchard.ContentManagement;
using Orchard.Localization;

namespace Piedone.ContentTemplates.Services
{
    public interface ITemplateLoader : IDependency
    {
        ITemplateLoaderDescriptor Descriptor { get; }
        bool CanHandle(IContent item);
        void LoadFromTemplate(IContent template, IContent item);
    }


    public interface ITemplateLoaderDescriptor
    {
        string Name { get; }
        LocalizedString DisplayName { get; }
        LocalizedString Description { get; }
    }

    public class TemplateLoaderDescriptor : ITemplateLoaderDescriptor
    {
        public string Name { get; private set; }
        public LocalizedString DisplayName { get; private set; }
        public LocalizedString Description { get; private set; }

        public TemplateLoaderDescriptor(string name, LocalizedString displayName, LocalizedString description)
        {
            Name = name;
            DisplayName = displayName;
            Description = description;
        }
    }
}
